<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="学院" prop="xyId">
        <!-- @change="handlelistPronj"  -->
        <el-select v-model="queryParams.xyId" @change="handlelistProzy(queryParams.xyId), handleQuery()" placeholder="请选择"
          filterable clearable>
          <el-option v-for="item in proxyList" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <!-- <el-form-item v-if="queryParams.xyId!=null" label="年级" prop="njId">
        <el-select v-model="queryParams.njId" @change="handlelistProzy" placeholder="请选择">
          <el-option
            v-for="item in pronjList"
            :key="item.id"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </el-form-item> -->
      <el-form-item label="专业" prop="zyId">
        <el-select v-model="queryParams.zyId" @change="handlelistProbj(queryParams.zyId), handleQuery()" placeholder="请选择"
          filterable clearable>
          <el-option v-for="item in prozyList" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="年级" prop="njId">
        <el-select v-model="queryParams.njId" placeholder="请选择" @change="handlelistProbj(queryParams.zyId), handleQuery()"
          clearable>
          <el-option v-for="item in pronjList" :key="item.id" :label="item.name" :value="item.name">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="班级" prop="clId">
        <el-select v-model="queryParams.clId" placeholder="请选择" @change="handleQuery" filterable clearable>
          <el-option v-for="item in probjList" :key="item.id" :label="item.name" :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="手机号" prop="phone">
        <el-input v-model="queryParams.phone" placeholder="请输入手机号" clearable @keyup.enter.native="handleQuery"
          @input="handleQuery" />
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"
          @input="handleQuery" />
      </el-form-item>
      <el-form-item label="学号" prop="stNumber">
        <el-input v-model="queryParams.stNumber" placeholder="请输入学号" clearable @keyup.enter.native="handleQuery"
          @input="handleQuery" />
      </el-form-item>
      <el-form-item label="状态" prop="clId" clearable>
        <el-select v-model="queryParams.status" placeholder="请选择" @change="handleQuery">
          <el-option v-for="item in statusList" :key="item" :label="item" :value="item">
          </el-option>
        </el-select>
      </el-form-item>
      <!-- <el-form-item label="密码" prop="password">
        <el-input
          v-model="queryParams.password"
          placeholder="请输入密码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> -->
        <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['project:prouser:add']" style="font-size: 14px;">新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['project:prouser:edit']" style="font-size: 14px;">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['project:prouser:remove']" style="font-size: 14px;">删除</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="prouserList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="头像" align="center" prop="userImage" width="100">
        <template slot-scope="scope">
          <image-preview :src="scope.row.userImage" :width="50" :height="50" />
        </template>
      </el-table-column>
      <el-table-column label="姓名" align="center" prop="name" />
      <el-table-column label="学号" align="center" prop="stNumber" min-width="150px" />
      <el-table-column label="性别" align="center" prop="sex" min-width="50px">
        <template slot-scope="scope">
          <span v-if="scope.row.sex === '0'">男</span>
          <span v-if="scope.row.sex === '1'">女</span>
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" prop="status" min-width="150px" />
      <el-table-column label="学院" align="center" prop="xyName" min-width="150px" />
      <!-- <el-table-column label="学校" align="center" prop="xxName" /> -->
      <el-table-column label="年级" align="center" prop="njName" min-width="100px" />
      <el-table-column label="专业" align="center" prop="zyName" min-width="150px" />
      <el-table-column label="班级" align="center" prop="bjName" min-width="150px" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" min-width="140">
        <template slot-scope="scope">
          <el-button size="mini" type="text" @click="handlePassword(scope.row)"
            v-hasPermi="['project:prouser:edit']">重置密码</el-button>
          <el-button size="mini" type="text" @click="handleUpdate(scope.row)"
            v-hasPermi="['project:prouser:edit']">修改</el-button>
          <el-button size="mini" type="text" @click="handleDelete(scope.row)"
            v-hasPermi="['project:prouser:remove']">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改用户管理对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @close="resetQuery">
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-form-item label="头像" prop="userImage">
          <image-upload v-model="form.userImage" :limit='1' />
        </el-form-item>
        <el-form-item label="姓名" prop="name">
          <el-input v-model="form.name" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="学号" prop="stNumber">
          <el-input v-model="form.stNumber" :maxlength="12" placeholder="请输入学号" />
        </el-form-item>
        <el-form-item label="手机号" prop="phone">
          <el-input v-model="form.phone" :maxlength="11" placeholder="请输入手机号" />
        </el-form-item>
        <el-form-item label="性别" prop="sex">
          <el-select v-model="form.sex" placeholder="请选择" clearable style="width:100%">
            <el-option key="0" label="男" value="0"></el-option>
            <el-option key="1" label="女" value="1"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="状态" prop="status" clearable>
          <el-select v-model="form.status" placeholder="请选择" style="width:100%" clearabl>
            <el-option v-for="item in statusList" :key="item" :label="item" :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="学院" prop="xyId">
          <el-select v-model="form.xyId" @change="handlelistProzy" placeholder="请选择" style="width:100%" clearable>
            <el-option v-for="item in proxyList" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item v-if="form.xyId != null" label="专业" prop="zyId">
          <el-select v-model="form.zyId" @change="handlelistProbj" placeholder="请选择" style="width:100%" clearable>
            <el-option v-for="item in prozyList" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item v-if="form.zyId != null" label="班级" prop="clId">
          <el-select v-model="form.clId" placeholder="请选择" style="width:100%" clearable>
            <el-option v-for="item in probjList" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 修改密码 -->
    <el-dialog :title="title" :visible.sync="open2" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="密码" prop="password">
          <el-input v-model="form.password" placeholder="请输入密码" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitresetPassword">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 用户成绩 -->
    <el-dialog :title="title" :visible.sync="openCj" width="1200px" append-to-body>
      <template>
        <div>
          <div class="w100 mt-20 bgff br-20 p-all-20 mb-20">
            <div class="w100 rowsc rowsm col333 fs-20 fw-b mb-20">劳动教育考核方案</div>
            <div class="fs-16 col666 mb-10">劳动总成绩=理论成绩×20%+实践成绩×80%</div>
            <div class="fs-16 col666">实践成绩=基础劳动成绩×60%+劳动总结报告成绩×20%+社会公益劳动成绩×10%+劳动成果成绩×10%</div>
          </div>

          <div class="w100 bgff br-20 mb-30">
            <div class="w100 rowsc rowsm h-60">1.实践成绩</div>
            <div class="w100 rows rowsm h-50">
              <div class="rowsc rowsm col333 fs-20 fw-b h100 w-100" style="background-color: rgba(227, 54, 54, .1);">类型
              </div>
              <div class="rowsc rowsm col333 fs-20 fw-b h100 w-170" style="background-color: rgba(227, 54, 54, .1);">基础劳动
              </div>
              <div class="rowsc rowsm col333 fs-20 fw-b h100 w-170" style="background-color: rgba(227, 54, 54, .1);">
                劳动总结报告</div>
              <div class="rowsc rowsm col333 fs-20 fw-b h100 w-170" style="background-color: rgba(227, 54, 54, .1);">
                社会公益劳动</div>
              <div class="rowsc rowsm col333 fs-20 fw-b h100 w-170" style="background-color: rgba(227, 54, 54, .1);">劳动成果
              </div>
              <div class="rowsc rowsm col333 fs-20 fw-b h100 w100" style="background-color: rgba(227, 54, 54, .1);">实践成绩
              </div>
            </div>
            <div class="w100 rows rowsm h-50">
              <div class="rowsc rowsm fs-20 h100 w-100 bgff" style="">原始成绩</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">80</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">90</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">90</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">80</div>
              <div class="rowsc rowsm fs-20 h100 w100 bgff" style="">/</div>
            </div>

            <div class="w100 rows rowsm h-50">
              <div class="rowsc rowsm col333 fs-20 h100 w-100 bgff" style="background-color: rgba(227, 227, 227, .47)">
                权重因子</div>
              <div class="rowsc rowsm col333 fs-20 h100 w-170 bgff" style="background-color: rgba(227, 227, 227, .47)">60%
              </div>
              <div class="rowsc rowsm col333 fs-20 h100 w-170 bgff" style="background-color: rgba(227, 227, 227, .47)">20%
              </div>
              <div class="rowsc rowsm col333 fs-20 h100 w-170 bgff" style="background-color: rgba(227, 227, 227, .47)">10%
              </div>
              <div class="rowsc rowsm col333 fs-20 h100 w-170 bgff" style="background-color: rgba(227, 227, 227, .47)">10%
              </div>
              <div class="rowsc rowsm col333 fs-20 h100 w100 bgff" style="background-color: rgba(227, 227, 227, .47)">/
              </div>
            </div>

            <div class="w100 rows rowsm h-50">
              <div class="rowsc rowsm fs-20 h100 w-100 bgff" style="">折算成绩</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">48</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">18</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">9</div>
              <div class="rowsc rowsm fs-20 h100 w-170 bgff" style="color: #E33636;">18</div>
              <div class="rowsc rowsm fs-20 h100 w100 bgff" style="">93</div>
            </div>
          </div>

          <div class="w100 bgff br-20 mb-30">
            <div class="w100 rowsc rowsm h-60">2.理论成绩</div>
            <div class="w100 h-50 rowsb rowsm">
              <div class="h100 rowsc rowsm col333 fs-20" style="width: 50%;background-color: rgba(227, 54, 54, .1);">理论成绩
              </div>
              <div class="h100 rowsc rowsm col333 fs-20" style="width: 50%;background-color: rgba(227, 227, 227, .47);"
                @click="active = 11">90</div>
            </div>
          </div>

          <div class="w100 bgff br-20">
            <div class="w100 rowsc rowsm h-60">3.劳动教育总成绩</div>
            <div class="w100 h-50 rows rowsm" style="background-color: rgba(227, 54, 54, .1);">
              <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">劳动总成绩</div>
              <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">理论成绩x20%</div>
              <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">实践成绩x80%</div>
            </div>
            <div class="w100 h-50 rows rowsm bgff">
              <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">92</div>
              <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">18</div>
              <div class="rowsc rowsm col333 fs-20" style="width: 33.3%;">74</div>
            </div>

          </div>
        </div>
      </template>
    </el-dialog>

    <!-- 督促 -->
    <el-dialog :title="title" :visible.sync="openDc" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="督促" prop="password">
          <el-select v-model="form.dcList" multiple placeholder="请选择">
            <el-option v-for="item in dcList" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitresetPassword">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { pronjList } from "@/api/project/prold";
import { listProuser, getProuser, delProuser, addProuser, updateProuser, resetPassword, listProxy, listProzy, listPronj, listProbj, listProxx, getCountCjByUser, addDcList } from "@/api/project/prouser";

export default {
  name: "Prouser",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 用户管理表格数据
      prouserList: [],
      //
      prozyList: [],
      proxyList: [],
      proxxList: [],
      pronjList: [],
      probjList: [],
      //用户成绩
      userCountCj: [],
      //
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      open2: false,
      openCj: false,
      openDc: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        uniId: null,
        openId: null,
        openId2: null,
        xyId: null,
        xxId: null,
        zyId: null,
        njId: null,
        clId: null,
        nickName: null,
        userImage: null,
        phone: null,
        name: null,
        stNumber: null,
        password: null,
        status: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        xyId: [
          { required: true, message: "学院不能为空", trigger: "blur" }
        ],
        xxId: [
          { required: true, message: "学校不能为空", trigger: "blur" }
        ],
        zyId: [
          { required: true, message: "专业不能为空", trigger: "blur" }
        ],
        njId: [
          { required: true, message: "年级不能为空", trigger: "blur" }
        ],
        clId: [
          { required: true, message: "班级不能为空", trigger: "blur" }
        ],
        phone: [
          { required: true, message: "手机号不能为空", trigger: "blur" },
          { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请输入正确的手机号', trigger: 'blur' }
        ],
        name: [
          { required: true, message: "姓名不能为空", trigger: "blur" }
        ],
        sex: [{ required: true, message: "性别不能为空", trigger: "change" }],
        status: [{ required: true, message: "状态不能为空", trigger: "change" }],
        stNumber: [
          { required: true, message: "学号不能为空", trigger: "blur" },
          // 12位数字
          { pattern: /^\d{12}$/, message: '请输入正确的学号', trigger: 'blur' }
        ],
      },
      dcList: [
        {
          value: '基础劳动',
          label: '基础劳动'
        }, {
          value: '劳动总结报告',
          label: '劳动总结报告'
        }, {
          value: '劳动成果',
          label: '劳动成果'
        }, {
          value: '社会公益劳动',
          label: '社会公益劳动'
        }, {
          value: '劳动理论',
          label: '劳动理论'
        }],
      statusList: ['在读', '休学', '退学', '停学', '复学', '流失', '毕业', '结业', '肄业', '转学(转出)', '死亡', '保留入学资格', '公派出国', '开除', '参军保留学籍', '下落不明', '转学', '转班级', '转专业', '其他'],
    };
  },
  created() {
    this.getInit();
    this.getList();
  },
  methods: {
    /** 查询用户管理列表 */
    getList() {
      this.loading = true;
      listProuser(this.queryParams).then(response => {
        this.prouserList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getInit() {
      // listProxx().then(response => {
      //   this.proxxList = response.rows;
      // });
      listProxy().then(response => {
        this.proxyList = response.rows;
      });
      listProzy().then(response => {
        this.prozyList = response.rows;
      });
      pronjList().then(response => {
        this.pronjList = response.rows;
      });
      listProbj().then(response => {
        this.probjList = response.rows;
      });
    },
    // getlistProxy() {
    //   listProxy(this.queryParams).then(response => {
    //     this.proxyList = response.rows;
    //   });
    // },
    // getlistProzy() {
    //   listProzy(this.queryParams).then(response => {
    //     this.prozyList = response.rows;
    //   });
    // },
    // getlistPronj() {
    //   listPronj(this.queryParams).then(response => {
    //     this.pronjList = response.rows;
    //   });
    // },
    // getlistProbj() {
    //   listProbj(this.queryParams).then(response => {
    //     this.probjList = response.rows;
    //   });
    // },
    // 取消按钮
    cancel() {
      this.open = false;
      this.open2 = false;
      this.openCj = false;
      this.openDc = false;

      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        userId: null,
        uniId: null,
        openId: null,
        openId2: null,
        xyId: null,
        xxId: null,
        zyId: null,
        njId: null,
        clId: null,
        nickName: null,
        userImage: null,
        phone: null,
        name: null,
        stNumber: null,
        password: null,
        createTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
      };
      this.resetForm("queryForm");
      this.getInit();
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.userId)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加学生信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const userId = row.userId || this.ids
      getProuser(userId).then(response => {
        response.data.userImage = process.env.VUE_APP_BASE_FILE + response.data.userImage
        this.form = response.data;
        this.open = true;
        this.title = "编辑学生信息";
        // listPronj({pId:row.xyId}).then(response => {
        //   this.pronjList = response.rows;
        // });
        listProzy({ pId: row.xyId }).then(response => {
          this.prozyList = response.rows;
        });
        listProbj({ pId: row.zyId }).then(response => {
          this.probjList = response.rows;
        });
      });
    },
    /** 重置密码 */
    handlePassword(row) {
      // this.reset();
      // const userId = row.userId || this.ids
      // getProuser(userId).then(response => {
      //   this.form.userId = response.data.userId;
      //   this.open2 = true;
      //   this.title = "修改密码";
      // });
      this.$confirm('是否重置密码？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.form.userId = row.userId || this.ids
        resetPassword(this.form).then(res => {
          if (res.code == 200) {
            this.$message.success('重置成功')
            this.open2 = false;
            this.getList();
          }
        });
      }).catch(() => { });
    },
    submitresetPassword() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.userId != null) {
            resetPassword(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open2 = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          // 把图片地址截取掉前缀
          this.form.userImage = this.form.userImage !== '' && this.form.userImage != null
            ? this.form.userImage.substring(28) : "";
          if (this.form.userId != null) {
            updateProuser(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addProuser(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const userIds = row.userId || this.ids;
      this.$modal.confirm('是否确认删除学生管理编号为"' + userIds + '"的数据项？').then(function () {
        return delProuser(userIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => { });
    },
    handlelistProxy() {
      listProxy(map).then(response => {
        this.proxyList = response.rows;
      });
    },
    // 选择学院
    // handlelistPronj(value){
    //   if(value){
    //     listPronj({
    //       pId:value
    //     }).then(response => {
    //       this.pronjList = response.rows;
    //     });
    //   }else{
    //     this.pronjList = []

    //   }
    //   //  this.form.xyId = null
    //   this.form.njId = null
    //   this.form.clId = null
    //   this.form.zyId = null
    //   this.queryParams.njId = null
    //   this.queryParams.zyId = null
    //   this.queryParams.clId = null
    // },
    // 选择年级
    handlelistProzy(value) {
      this.prozyList = [];
      listProzy({
        xyIds: value
      }).then(response => {
        this.probjList = [];
        this.prozyList = response.rows;
        if (response.rows.length > 0) {
          this.handlelistProbj();
        }
      });
      this.form.clId = null;
      this.form.zyId = null;
      // this.queryParams.xyId = null;
      this.queryParams.zyId = null;
      this.queryParams.clId = null;
    },
    // 选择专业
    handlelistProbj(value) {
      var map = {};
      map.zyIds = value || this.prozyList.map(v => v.id);
      map.njIds = this.queryParams.njId || this.pronjList.map(v => v.name);
      if (!value) {
        this.queryParams.zyId = null;
      }
      if (this.prozyList.length === 0) return
      listProbj(map).then(response => {
        this.probjList = [];
        this.probjList = response.rows;
      });
      this.form.clId = null
      this.queryParams.clId = null
    },
    //获取成绩
    handCountCjByUser(row) {
      var map = {};
      map.userId = row.userId;
      getCountCjByUser(map).then(response => {
        this.userCountCj = response.rows;
        this.openCj = true;
        this.title = "用户成绩";
      });
    },
    handleDc(row) {
      const userId = row.userId || this.ids
      getProuser(userId).then(response => {
        this.form.userId = response.data.userId;
        this.openDc = true;
        this.title = "督促";
      });
    },
    subDc() {
      addDcList(this.form).then(response => {
        this.openDc = false;
        this.$modal.msgSuccess("操作成功");
      });
    }
  }
};
</script>
